package com.banyuan;

public class Student {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age >0 && age < 30) {
            this.age = age;
            return;
        }
        System.out.println("你超过年龄了，不给学习");
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                '}';
    }
}
